<?php
/*动作基类*/
class CommonAction extends Action {

	//初始化
	function _initialize(){
		load('extend'); //ThinkPHP/Extend/Function/extend.php
		header('Content-Type:text/html;charset=utf-8');
	}
    //返回json格式的数据
    public function json($data) {
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
        header("Cache-Control: no-cache, must-revalidate");
        header("Pragma: no-cache");
        header("Content-type: text/x-json");
        echo json_encode($data);
        exit;
    }
    //空操作
	public function _empty(){
		$this->redirect("/");
	}
}